package com.dsh.materialSetting.controller;

import com.dsh.materialSetting.entity.MaterialSetting;
import com.dsh.materialSetting.entity.PurchaseSetting;
import com.dsh.materialSetting.service.MaterialSettingService;
import com.dsh.model.Result;
import com.dsh.payMethod.entity.ChargeEntity;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * 物资设置(MaterialSetting)表控制层
 *
 * @author makejava
 * @since 2022-05-12 16:19:03
 */
@Api(tags = "库存设置")
@RestController
@RequestMapping("materialSetting")
public class MaterialSettingController {
    /**
     * 服务对象
     */
    @Resource
    private MaterialSettingService materialSettingService;

    /**
     * 通过主键查询单条数据
     *
     * @return 单条数据
     */
    @ApiOperation(value = "库存设置",response = MaterialSetting.class)
    @GetMapping("selectOneMaterial")
    public Result selectOneMaterial(){
        MaterialSetting materialSetting = materialSettingService.selectOneMaterial();
        return Result.success(materialSetting,"");
    }
    @ApiOperation(value = "采购",response = PurchaseSetting.class)
    @GetMapping("selectAllPurchase")
    public Result selectAllPurchase(){
        List<PurchaseSetting> purchaseSettings = materialSettingService.selectAllPurchase();
        return Result.success(purchaseSettings,"");
    }
}
